//
//  RecommentComicHead.swift
//  Spookiness
//
//  Created by 腾億 on 2017/12/7.
//  Copyright © 2017年 tml. All rights reserved.
//

import UIKit

protocol RecommentComicDelegate: class {
    func comicHead(_ comicHead: RecommentComicHead, moreAction: UIButton)
}

class RecommentComicHead: UICollectionReusableView {
 
    weak var delegate: RecommentComicDelegate?
    
     lazy var iocnView: UIImageView = {
       return UIImageView()
    }()
    
     lazy var titleLable: UILabel = {
       let label = UILabel()
        label.textColor = UIColor.black
        label.font = UIFont.systemFont(ofSize: 14)
        return label
    }()
    
    lazy var moreButton: UIButton = {
       let button = UIButton(type: .custom)
        button.addTarget(self, action: #selector(moreAction), for: .touchUpInside)
        return button
    }()
    
    @objc fileprivate func moreAction() {
        
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.addSubview(self.iocnView)
        self.addSubview(self.titleLable)
        self.addSubview(self.moreButton)
        setUpSnap()
    }
    
    fileprivate func setUpSnap() {
        self.iocnView.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(5)
            make.centerY.equalToSuperview()
            make.width.height.equalTo(40)
        }
        
        self.titleLable.snp.makeConstraints { (make) in
            make.left.equalTo(self.iocnView.snp.right).offset(5)
            make.centerY.height.equalTo(self.iocnView)
            make.width.equalTo(200)
        }
        
        self.moreButton.snp.makeConstraints { (make) in
            make.top.right.bottom.equalToSuperview()
            make.width.equalTo(40)
        }
    }
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
